package com.ss.android.account.v2.view;

import android.animation.AnimatorSet;
import android.graphics.Rect;
import android.os.Build;
import android.view.View;
import android.view.ViewTreeObserver;
import com.ss.android.account.e.AccountAnimatorHelper;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

final class n implements ViewTreeObserver.OnGlobalLayoutListener {
    private final m c;
    private final Rect a;
    private final int b;

    n(m arg1, Rect arg2, int arg3) {
        this.c = arg1;
        this.a = arg2;
        this.b = arg3;

    }

    public final void onGlobalLayout() {
        if(Build.VERSION.SDK_INT >= 16) {
            this.c.a.g.getViewTreeObserver().removeOnGlobalLayoutListener(((ViewTreeObserver.OnGlobalLayoutListener)this));
        }
        else {
            this.c.a.g.getViewTreeObserver().removeGlobalOnLayoutListener(((ViewTreeObserver.OnGlobalLayoutListener)this));
        }

        this.c.a.g.getGlobalVisibleRect(this.a);
        int v0 = this.a.left;
        h v1 = this.c.a;
        int v2 = v0 - this.b;
        List v0_1 = this.c.a.i;
        List v3 = this.c.a.j;
        ArrayList v4 = new ArrayList();
        Iterator v5 = v0_1.iterator();
        while(v5.hasNext()) {
            ((List)v4).add(AccountAnimatorHelper.createTranslationXAnimator((View) v5.next(), -v2, 0));
        }

        Iterator v3_1 = v3.iterator();
        while(v3_1.hasNext()) {
            Object v0_2 = v3_1.next();
            ((List)v4).add(AccountAnimatorHelper.createTranslationXAnimator(((View)v0_2), -v2, 0));
            ((List)v4).add(AccountAnimatorHelper.createFastFadeInAnimation(((View)v0_2)));
        }

        AnimatorSet v0_3 = new AnimatorSet();
        v0_3.playTogether(((Collection)v4));
        v1.k = v0_3;
        this.c.a.k.start();
    }
}

